package com.rd.student.dashuju.sunwenzhuo.Test1.LinkListDemo;

import java.util.LinkedList;

public class LinkedListTest {
    public static void main(String[] args) {

        LinkedList list1 = new LinkedList();
        Student1 student11 = new Student1();
        student11.setClassNum("21-1班");
        student11.setMajor("大数据");
        student11.setName("孙文卓");

        Student1 student12 = new Student1();
        student12.setClassNum("21-3班");
        student12.setMajor("大数据");
        student12.setName("王博");

        Student1 student13 = new Student1();
        student13.setClassNum("21-1班");
        student13.setMajor("大数据");
        student13.setName("郑成祥");

        Student1 student14 = new Student1();
        student14.setClassNum("21-1班");
        student14.setMajor("大数据");
        student14.setName("郑睿娴");

        Student1 student15 = new Student1();
        student15.setClassNum("21-3班");
        student15.setMajor("物联网");
        student15.setName("王高博");


        list1.add(student11);
        list1.add(student12);
        list1.add(student13);
        list1.add(student14);
        list1.add(student15);
        for (Object obj : list1){
            System.out.println(obj);
        }

    }
}

class Student1 {
    private String name;
    private String major;
    private String classNum;

    public void setName(String name) {
        this.name = name;
    }

    public void setClassNum(String classNum) {
        this.classNum = classNum;
    }

    public void setMajor(String major) {
        this.major = major;
    }


    public Student1() {

    }


    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", major='" + major + '\'' +
                ", classNum='" + classNum + '\'' +
                '}';
    }
}
